package cevent.source.cloudcenter.server.enums;

/** 文件用途说明
 * Created by Cevent on 2021/4/26.
 */
public enum UseTypeEnum {
    SOURCE_PUBLIC("P","公共资源"),
    SOURCE_IUSE("I","私有资源"),
    SOURCE_PROPAGANDA("R","公司宣传资料"),
    SOURCE_ACTIVE("A","公司活动资料"),
    SOURCE_PRODUCT("C","公司产品资料"),
    SOURCE_LOGO("L","公司LOGO"),
    SOURCE_TEMPLATE("T","其他");
    private String code;
    private String desc;

    UseTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    //根据code获取枚举类型
    public static UseTypeEnum getByCode(String code){
        for(UseTypeEnum u:UseTypeEnum.values()){
            if(code.equals(u.getCode())){
                return u;
            }
        }
        return null;
    }
}
